// Drummer
// by Andrea Bianchi
// andreabianchi.alsoplantsfly.com

/*
 Copyright (C) 2009, Andrea Bianchi
 
 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
 as published by the Free Software Foundation; either version 2
 of the License, or (at your option) any later version.
 
 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
*/


#ifndef _DOUBLE_COLOR__H__
#define _DOUBLE_COLOR__H__

#include "global.h"


namespace DS
{



	class RBGColor 
	{
	public:
		RBGColor ():r_(0), b_(0), g_(0){}
		RBGColor (u16 r, u16 b, u16 g):r_(r), b_(b), g_(g){}
		RBGColor (const RBGColor& o):r_(o.r_), b_(o.b_), g_(o.g_) {}

		inline RBGColor& operator=(const RBGColor& o) { r_=o.r_; b_=o.b_; g_=o.g_; return *this;}
		inline const RBGColor operator+(const RBGColor& a) const { return RBGColor(r_+a.r_, b_+a.b_, g_+a.g_); }
		inline const RBGColor operator-(const RBGColor& a) const { return RBGColor(r_-a.r_, b_-a.b_, g_-a.g_); }
		inline const RBGColor operator*(u8 scale) const { return RBGColor(r_*scale, b_*scale, g_*scale); }
		inline const RBGColor operator/(u8 scale) const { return RBGColor(r_/scale, b_/scale, g_/scale); }
	
		s16 r_, b_, g_;
	};



	class DoubleColor 
	{
	public:
		DoubleColor():one_(RBGColor()), two_(RBGColor()){}
		DoubleColor (const RBGColor& one, const RBGColor& two): one_(one), two_(two){}
		// percentage is a number between 0 and 100
		Color computeColor(u8 percentage);

	private:
		RBGColor one_, two_;
	};


	// some constants here for the colors
	static DoubleColor none (RBGColor(0,0,0), RBGColor(0,0,0));
	static DoubleColor red (RBGColor(255,40,40), RBGColor(179,24,24));
	static DoubleColor green (RBGColor(65,234,13), RBGColor(12,138,27));
	static DoubleColor blue (RBGColor(10,193, 253), RBGColor(14,41,130));
	static DoubleColor grey (RBGColor(200,200,200), RBGColor(117,118,123));
	static DoubleColor yellow (RBGColor(248,251,12), RBGColor(248,251,12));
	static DoubleColor pink (RBGColor(255,129,236), RBGColor(177,26,154));
	static DoubleColor orange (RBGColor(255,190,0), RBGColor(255,144,0));
}

#endif _DOUBLE_COLOR__H__